#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

char *_strcpy(char *dest, const char *src)
{
	assert( (dest != NULL) && (src != NULL));
	char *adr;
	
	adr = dest;
	while ( (*dest++ = *src++) != '\0');
	
	return adr;
}

int main()
{
	char name[5] = "asdf";
	char *p1 = "name";
	char *p2;
	int i;
	

	p2 = (char *)malloc(20);
	memset(p2, 0, 20);
	
	p2 = "xiaozhixiaozhixiaozhixiaozhixiaozhixiaozhi";
	//*p2++ = 'b';
	//*p2++ = 'c';
	
	//					4	4		4		5
	printf(" == %s %d %d %d %d\n", p1, strlen(p1), sizeof(p1), strlen(name), sizeof(name));	
	printf(" == %s %d %d\n", p2, strlen(p2), sizeof(p2));	
	
	//while(*p2++ = *p1++);
	//while((*p2++ = *p1++) != 4);
	for (i = 0; i < 3; i++)
		name[i] = *p1++;
	//*p2 = '\0';
	printf("%s\n", name);
}

